package cn.chaohi.common.domain.cloudstorage.coupon;

import cn.chaohi.common.Const;
import cn.chaohi.utils.MoneyUtil;

/**
 * 优惠券信息对象.
 * 
 * @author bobo
 *
 */
public class CouponInfoModel {

	/**
	 * 优惠券类型
	 */
	private String coupon_type;
	/**
	 * 优惠券额度.
	 */
	private String coupon_amount;
	/**
	 * 使用限额.
	 */
	private String use_limit_amount;
	/**
	 * 有效期
	 */
	private String fail_time;
	public CouponInfoModel() {
	}

	public CouponInfoModel(UserCouponRes userCouponModel) {
		if(userCouponModel != null){
			//优惠券金额
			this.coupon_amount = MoneyUtil.moneyFormat(userCouponModel.getCoupon_amount());
			//优惠券类型
			Integer type = userCouponModel.getCoupon_type();
			if(Const.COUPON_TYPE_YHQ.equals(type)){
				this.coupon_type = "优惠券";
			} else if(Const.COUPON_TYPE_XJQ.equals(type)){
				this.coupon_type = "现金券";
			}
			//使用限额
			this.use_limit_amount = MoneyUtil.moneyFormat(userCouponModel.getUse_limit_amount());
			//有效期
			this.fail_time = userCouponModel.getFail_time();
		}
	}

	public String getCoupon_type() {
		return coupon_type;
	}

	public void setCoupon_type(String coupon_type) {
		this.coupon_type = coupon_type;
	}

	public String getCoupon_amount() {
		return coupon_amount;
	}

	public void setCoupon_amount(String coupon_amount) {
		this.coupon_amount = coupon_amount;
	}

	public String getUse_limit_amount() {
		return use_limit_amount;
	}

	public void setUse_limit_amount(String use_limit_amount) {
		this.use_limit_amount = use_limit_amount;
	}

	public String getFail_time() {
		return fail_time;
	}

	public void setFail_time(String fail_time) {
		this.fail_time = fail_time;
	}

}
